/*     */ package blockbuster.emitter;
/*     */ import blockbuster.BedrockScheme;
/*     */ import blockbuster.components.IComponentEmitterInitialize;
/*     */ import blockbuster.components.IComponentEmitterUpdate;
/*     */ import blockbuster.components.IComponentParticleMorphRender;
/*     */ import blockbuster.components.IComponentParticleRender;
/*     */ import blockbuster.components.IComponentParticleUpdate;
/*     */ import blockbuster.components.IComponentRenderBase;
/*     */ import blockbuster.components.appearance.BedrockComponentCollisionAppearance;
/*     */ import blockbuster.components.meta.BedrockComponentInitialization;
/*     */ import blockbuster.math.IValue;
/*     */ import blockbuster.math.Variable;
/*     */ import blockbuster.utils.Interpolations;
/*     */ import java.util.ArrayList;
/*     */ import java.util.HashMap;
/*     */ import java.util.Iterator;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ import java.util.UUID;
/*     */ import javax.vecmath.Matrix3f;
/*     */ import javax.vecmath.Tuple3d;
/*     */ import javax.vecmath.Vector3d;
/*     */ import javax.vecmath.Vector3f;
/*     */ import net.minecraft.client.Minecraft;
/*     */ import net.minecraft.client.renderer.BufferBuilder;
/*     */ import net.minecraft.client.renderer.GlStateManager;
/*     */ import net.minecraft.client.renderer.Tessellator;
/*     */ import net.minecraft.entity.Entity;
/*     */ import net.minecraft.entity.EntityLivingBase;
/*     */ import net.minecraft.util.ResourceLocation;
/*     */ import net.minecraft.util.math.BlockPos;
/*     */ import net.minecraft.world.World;
/*     */ 
/*     */ public class BedrockEmitter {
/*  35 */   public List<BedrockParticle> particles = new ArrayList<>(); public BedrockScheme scheme;
/*  36 */   public List<BedrockParticle> splitParticles = new ArrayList<>();
/*     */   public Map<String, IValue> variables;
/*  38 */   public Map<String, Double> initialValues = new HashMap<>();
/*     */   
/*     */   public UUID targetUUID;
/*     */   
/*     */   public EntityLivingBase target;
/*     */   
/*     */   public World world;
/*     */   
/*     */   public boolean lit;
/*     */   
/*     */   public boolean added;
/*     */   
/*     */   public int sanityTicks;
/*     */   
/*     */   public int maxLifeTicks;
/*     */   public MolangExpression[] rotationsParser;
/*     */   public boolean look;
/*     */   public boolean running = true;
/*  56 */   public Vector3d lastGlobal = new Vector3d();
/*  57 */   public Vector3d prevGlobal = new Vector3d();
/*  58 */   public Matrix3f rotation = new Matrix3f(1.0F, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F, 0.0F, 1.0F);
/*  59 */   public Matrix3f prevRotation = new Matrix3f(1.0F, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F, 0.0F, 1.0F);
/*  60 */   public Vector3f angularVelocity = new Vector3f();
/*  61 */   public Vector3d translation = new Vector3d();
/*     */   
/*     */   public int age;
/*     */   public int lifetime;
/*     */   public double spawnedParticles;
/*     */   public boolean playing = true;
/*  67 */   public float random1 = (float)Math.random();
/*  68 */   public float random2 = (float)Math.random();
/*  69 */   public float random3 = (float)Math.random();
/*  70 */   public float random4 = (float)Math.random();
/*  71 */   public double[] scale = new double[] { 1.0D, 1.0D, 1.0D };
/*     */   
/*     */   public int perspective;
/*     */   public float cYaw;
/*     */   public float cPitch;
/*     */   public double cX;
/*     */   public double cY;
/*     */   public double cZ;
/*     */   private BedrockParticle guiParticle;
/*  80 */   private BlockPos.MutableBlockPos blockPos = new BlockPos.MutableBlockPos();
/*     */   
/*     */   private Variable varAge;
/*     */   
/*     */   private Variable varLifetime;
/*     */   
/*     */   private Variable varRandom1;
/*     */   
/*     */   private Variable varRandom2;
/*     */   
/*     */   private Variable varRandom3;
/*     */   private Variable varRandom4;
/*     */   private Variable varSpeedABS;
/*     */   private Variable varSpeedX;
/*     */   private Variable varSpeedY;
/*     */   private Variable varSpeedZ;
/*     */   private Variable varBounces;
/*     */   private Variable varEmitterAge;
/*     */   private Variable varEmitterLifetime;
/*     */   private Variable varEmitterRandom1;
/*     */   private Variable varEmitterRandom2;
/*     */   private Variable varEmitterRandom3;
/*     */   private Variable varEmitterRandom4;
/*     */   public double extraX;
/*     */   public double extraY;
/*     */   public double extraZ;
/*     */   
/*     */   public boolean isFinished() {
/* 108 */     return (!this.running && this.particles.isEmpty());
/*     */   }
/*     */   
/*     */   public double getDistanceSq() {
/* 112 */     setupCameraProperties(0.0F);
/*     */     
/* 114 */     double dx = this.cX - this.lastGlobal.x;
/* 115 */     double dy = this.cY - this.lastGlobal.y;
/* 116 */     double dz = this.cZ - this.lastGlobal.z;
/*     */     
/* 118 */     return dx * dx + dy * dy + dz * dz;
/*     */   }
/*     */   
/*     */   public double getAge() {
/* 122 */     return getAge(0.0F);
/*     */   }
/*     */   
/*     */   public double getAge(float partialTicks) {
/* 126 */     return (this.age + partialTicks) / 20.0D;
/*     */   }
/*     */   
/*     */   public void updateTarget() {
/* 130 */     if (this.targetUUID != null) {
/* 131 */       EntityLivingBase livingEntity = findLivingEntity(this.targetUUID);
/* 132 */       if (livingEntity != null) {
/* 133 */         setTarget(livingEntity);
/*     */       }
/*     */     } 
/*     */   }
/*     */   
/*     */   public void setWorld(World world) {
/* 139 */     this.world = world;
/*     */   }
/*     */   
/*     */   public void setTarget(EntityLivingBase target) {
/* 143 */     this.target = target;
/* 144 */     this.world = (target == null) ? null : target.field_70170_p;
/*     */   }
/*     */   
/*     */   public void setScheme(BedrockScheme scheme) {
/* 148 */     setScheme(scheme, null);
/*     */   }
/*     */   
/*     */   public void setScheme(BedrockScheme scheme, Map<String, String> variables) {
/* 152 */     this.scheme = scheme;
/*     */     
/* 154 */     if (this.scheme == null) {
/*     */       return;
/*     */     }
/*     */     
/* 158 */     if (variables != null) {
/* 159 */       parseVariables(variables);
/*     */     }
/*     */     
/* 162 */     this.lit = true;
/* 163 */     stop();
/* 164 */     start();
/*     */     
/* 166 */     setupVariables();
/* 167 */     setEmitterVariables(0.0F);
/*     */   }
/*     */ 
/*     */ 
/*     */   
/*     */   public void setupVariables() {
/* 173 */     this.varAge = (Variable)this.scheme.parser.variables.get("variable.particle_age");
/* 174 */     this.varLifetime = (Variable)this.scheme.parser.variables.get("variable.particle_lifetime");
/* 175 */     this.varRandom1 = (Variable)this.scheme.parser.variables.get("variable.particle_random_1");
/* 176 */     this.varRandom2 = (Variable)this.scheme.parser.variables.get("variable.particle_random_2");
/* 177 */     this.varRandom3 = (Variable)this.scheme.parser.variables.get("variable.particle_random_3");
/* 178 */     this.varRandom4 = (Variable)this.scheme.parser.variables.get("variable.particle_random_4");
/*     */     
/* 180 */     this.varSpeedABS = (Variable)this.scheme.parser.variables.get("variable.particle_speed.length");
/* 181 */     this.varSpeedX = (Variable)this.scheme.parser.variables.get("variable.particle_speed.x");
/* 182 */     this.varSpeedY = (Variable)this.scheme.parser.variables.get("variable.particle_speed.y");
/* 183 */     this.varSpeedZ = (Variable)this.scheme.parser.variables.get("variable.particle_speed.z");
/* 184 */     this.varBounces = (Variable)this.scheme.parser.variables.get("variable.particle_bounces");
/*     */     
/* 186 */     this.varEmitterAge = (Variable)this.scheme.parser.variables.get("variable.emitter_age");
/* 187 */     this.varEmitterLifetime = (Variable)this.scheme.parser.variables.get("variable.emitter_lifetime");
/* 188 */     this.varEmitterRandom1 = (Variable)this.scheme.parser.variables.get("variable.emitter_random_1");
/* 189 */     this.varEmitterRandom2 = (Variable)this.scheme.parser.variables.get("variable.emitter_random_2");
/* 190 */     this.varEmitterRandom3 = (Variable)this.scheme.parser.variables.get("variable.emitter_random_3");
/* 191 */     this.varEmitterRandom4 = (Variable)this.scheme.parser.variables.get("variable.emitter_random_4");
/*     */   }
/*     */   
/*     */   public void setParticleVariables(BedrockParticle particle, float partialTicks) {
/* 195 */     if (this.varAge != null) this.varAge.set(particle.getAge(partialTicks)); 
/* 196 */     if (this.varLifetime != null) this.varLifetime.set(particle.lifetime / 20.0D); 
/* 197 */     if (this.varRandom1 != null) this.varRandom1.set(particle.random1); 
/* 198 */     if (this.varRandom2 != null) this.varRandom2.set(particle.random2); 
/* 199 */     if (this.varRandom3 != null) this.varRandom3.set(particle.random3); 
/* 200 */     if (this.varRandom4 != null) this.varRandom4.set(particle.random4);
/*     */     
/* 202 */     if (this.varSpeedABS != null) this.varSpeedABS.set(particle.speed.length()); 
/* 203 */     if (this.varSpeedX != null) this.varSpeedX.set(particle.speed.x); 
/* 204 */     if (this.varSpeedY != null) this.varSpeedY.set(particle.speed.y); 
/* 205 */     if (this.varSpeedZ != null) this.varSpeedZ.set(particle.speed.z); 
/* 206 */     if (this.varBounces != null) this.varBounces.set(particle.bounces);
/*     */     
/* 208 */     this.scheme.updateCurves();
/*     */     
/* 210 */     BedrockComponentInitialization component = (BedrockComponentInitialization)this.scheme.get(BedrockComponentInitialization.class);
/*     */     
/* 212 */     if (component != null) {
/* 213 */       component.particleUpdate.get();
/*     */     }
/*     */   }
/*     */   
/*     */   public void setEmitterVariables(float partialTicks) {
/* 218 */     for (Map.Entry<String, Double> entry : this.initialValues.entrySet()) {
/* 219 */       Variable var = (Variable)this.scheme.parser.variables.get(entry.getKey());
/*     */       
/* 221 */       if (var != null) {
/* 222 */         var.set(((Double)entry.getValue()).doubleValue());
/*     */       }
/*     */     } 
/*     */     
/* 226 */     if (this.varEmitterAge != null) this.varEmitterAge.set(getAge(partialTicks)); 
/* 227 */     if (this.varEmitterLifetime != null) this.varEmitterLifetime.set(this.lifetime / 20.0D); 
/* 228 */     if (this.varEmitterRandom1 != null) this.varEmitterRandom1.set(this.random1); 
/* 229 */     if (this.varEmitterRandom2 != null) this.varEmitterRandom2.set(this.random2); 
/* 230 */     if (this.varEmitterRandom3 != null) this.varEmitterRandom3.set(this.random3); 
/* 231 */     if (this.varEmitterRandom4 != null) this.varEmitterRandom4.set(this.random4);
/*     */     
/* 233 */     this.scheme.updateCurves();
/*     */   }
/*     */   
/*     */   public void parseVariables(Map<String, String> variables) {
/* 237 */     this.variables = new HashMap<>();
/*     */     
/* 239 */     for (Map.Entry<String, String> entry : variables.entrySet()) {
/* 240 */       parseVariable(entry.getKey(), entry.getValue());
/*     */     }
/*     */   }
/*     */   
/*     */   public void parseVariable(String name, String expression) {
/*     */     try {
/* 246 */       this.variables.put(name, this.scheme.parser.parse(expression));
/* 247 */     } catch (Exception exception) {}
/*     */   }
/*     */ 
/*     */   
/*     */   public void replaceVariables() {
/* 252 */     if (this.variables == null) {
/*     */       return;
/*     */     }
/*     */     
/* 256 */     for (Map.Entry<String, IValue> entry : this.variables.entrySet()) {
/* 257 */       Variable var = (Variable)this.scheme.parser.variables.get(entry.getKey());
/*     */       
/* 259 */       if (var != null) {
/* 260 */         var.set(((IValue)entry.getValue()).get().doubleValue());
/*     */       }
/*     */     } 
/*     */   }
/*     */   
/*     */   public void start() {
/* 266 */     if (this.playing) {
/*     */       return;
/*     */     }
/*     */     
/* 270 */     this.age = 0;
/* 271 */     this.spawnedParticles = 0.0D;
/* 272 */     this.playing = true;
/*     */     
/* 274 */     for (IComponentEmitterInitialize component : this.scheme.emitterInitializes) {
/* 275 */       component.apply(this);
/*     */     }
/*     */   }
/*     */   
/*     */   public void stop() {
/* 280 */     if (!this.playing) {
/*     */       return;
/*     */     }
/*     */     
/* 284 */     this.spawnedParticles = 0.0D;
/* 285 */     this.playing = false;
/*     */     
/* 287 */     this.random1 = (float)Math.random();
/* 288 */     this.random2 = (float)Math.random();
/* 289 */     this.random3 = (float)Math.random();
/* 290 */     this.random4 = (float)Math.random();
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public void stopWithOnce() {}
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public void update() {
/* 302 */     if (this.scheme == null) {
/*     */       return;
/*     */     }
/*     */     
/* 306 */     setEmitterVariables(0.0F);
/*     */     
/* 308 */     for (IComponentEmitterUpdate component : this.scheme.emitterUpdates) {
/* 309 */       component.update(this);
/*     */     }
/*     */     
/* 312 */     setEmitterVariables(0.0F);
/* 313 */     updateParticles();
/*     */     
/* 315 */     this.age++;
/*     */     
/* 317 */     this.sanityTicks++;
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   private void updateParticles() {
/* 324 */     Iterator<BedrockParticle> it = this.particles.iterator();
/*     */     
/* 326 */     while (it.hasNext()) {
/* 327 */       BedrockParticle particle = it.next();
/*     */       
/* 329 */       updateParticle(particle);
/*     */       
/* 331 */       if (particle.dead) {
/* 332 */         it.remove();
/*     */       }
/*     */     } 
/*     */     
/* 336 */     if (!this.splitParticles.isEmpty()) {
/* 337 */       this.particles.addAll(this.splitParticles);
/* 338 */       this.splitParticles.clear();
/*     */     } 
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   private void updateParticle(BedrockParticle particle) {
/* 346 */     particle.update(this);
/*     */     
/* 348 */     setParticleVariables(particle, 0.0F);
/*     */     
/* 350 */     for (IComponentParticleUpdate component : this.scheme.particleUpdates) {
/* 351 */       component.update(this, particle);
/*     */     }
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public void spawnParticle() {
/* 359 */     if (!this.running) {
/*     */       return;
/*     */     }
/*     */     
/* 363 */     if (this.target != null && this.target.field_70128_L) {
/*     */       return;
/*     */     }
/* 366 */     this.particles.add(createParticle(false));
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public BedrockParticle createParticle(boolean forceRelative) {
/* 373 */     BedrockParticle particle = new BedrockParticle();
/*     */     
/* 375 */     setParticleVariables(particle, 0.0F);
/* 376 */     particle.setupMatrix(this);
/*     */     
/* 378 */     for (IComponentParticleInitialize component : this.scheme.particleInitializes) {
/* 379 */       component.apply(this, particle);
/*     */     }
/*     */     
/* 382 */     if (particle.relativePosition && !particle.relativeRotation) {
/* 383 */       Vector3f vec = new Vector3f(particle.position);
/*     */       
/* 385 */       particle.matrix.transform((Tuple3f)vec);
/*     */       
/* 387 */       particle.position.x = vec.x;
/* 388 */       particle.position.y = vec.y;
/* 389 */       particle.position.z = vec.z;
/*     */     } 
/*     */     
/* 392 */     if (!particle.relativePosition || !particle.relativeRotation) {
/* 393 */       particle.position.add((Tuple3d)this.lastGlobal);
/* 394 */       particle.initialPosition.add((Tuple3d)this.lastGlobal);
/*     */     } 
/*     */     
/* 397 */     particle.prevPosition.set((Tuple3d)particle.position);
/* 398 */     particle.rotation = particle.initialRotation;
/* 399 */     particle.prevRotation = particle.rotation;
/*     */     
/* 401 */     return particle;
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public void render(float partialTicks) {
/* 409 */     if (this.scheme == null) {
/*     */       return;
/*     */     }
/*     */     
/* 413 */     setupCameraProperties(partialTicks);
/*     */     
/* 415 */     List<IComponentParticleRender> renders = this.scheme.particleRender;
/* 416 */     List<IComponentParticleMorphRender> morphRenders = this.scheme.particleMorphRender;
/*     */     
/* 418 */     boolean morphRendering = false;
/* 419 */     boolean particleRendering = true;
/*     */ 
/*     */     
/* 422 */     if (particleRendering) {
/* 423 */       setupOpenGL(partialTicks);
/*     */       
/* 425 */       for (IComponentParticleRender component : renders) {
/* 426 */         component.preRender(this, partialTicks);
/*     */       }
/*     */       
/* 429 */       if (!this.particles.isEmpty() && (this.targetUUID == null || this.target != null)) {
/* 430 */         depthSorting();
/*     */         
/* 432 */         renderParticles(this.scheme.texture, renders, false, partialTicks);
/*     */         
/* 434 */         BedrockComponentCollisionAppearance collisionAppearance = (BedrockComponentCollisionAppearance)this.scheme.getOrCreate(BedrockComponentCollisionAppearance.class);
/*     */ 
/*     */         
/* 437 */         if (collisionAppearance != null && collisionAppearance.texture != null) {
/* 438 */           renderParticles(collisionAppearance.texture, renders, true, partialTicks);
/*     */         }
/*     */       } 
/*     */       
/* 442 */       for (IComponentParticleRender component : renders) {
/* 443 */         component.postRender(this, partialTicks);
/*     */       }
/*     */       
/* 446 */       endOpenGL();
/*     */     } 
/*     */ 
/*     */     
/* 450 */     if (morphRendering) {
/* 451 */       for (IComponentParticleMorphRender component : morphRenders) {
/* 452 */         component.preRender(this, partialTicks);
/*     */       }
/*     */       
/* 455 */       if (!this.particles.isEmpty()) {
/*     */         
/* 457 */         if (!particleRendering) {
/* 458 */           depthSorting();
/*     */         }
/*     */         
/* 461 */         renderParticles(morphRenders, false, partialTicks);
/*     */       } 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */       
/* 471 */       for (IComponentParticleMorphRender component : morphRenders) {
/* 472 */         if (component.getClass() == BedrockComponentRateSteady.class) {
/* 473 */           if (!particleRendering)
/*     */           {
/* 475 */             component.postRender(this, partialTicks); } 
/*     */           continue;
/*     */         } 
/* 478 */         component.postRender(this, partialTicks);
/*     */       } 
/*     */     } 
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   private void renderParticles(List<? extends IComponentParticleMorphRender> renderComponents, boolean collided, float partialTicks) {
/* 492 */     BufferBuilder builder = Tessellator.func_178181_a().func_178180_c();
/*     */     
/* 494 */     for (BedrockParticle particle : this.particles) {
/* 495 */       setEmitterVariables(partialTicks);
/* 496 */       setParticleVariables(particle, partialTicks);
/*     */       
/* 498 */       for (IComponentRenderBase component : renderComponents) {
/* 499 */         component.render(this, particle, builder, partialTicks);
/*     */       }
/*     */     } 
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   private void renderParticles(ResourceLocation texture, List<? extends IComponentParticleRender> renderComponents, boolean collided, float partialTicks) {
/* 513 */     BufferBuilder builder = Tessellator.func_178181_a().func_178180_c();
/*     */     
/* 515 */     GifHandler.bindTexture(texture, this.age, partialTicks);
/*     */     
/* 517 */     builder.func_181668_a(7, DefaultVertexFormats.field_181711_k);
/*     */     
/* 519 */     for (BedrockParticle particle : this.particles) {
/* 520 */       boolean collisionStuff = (particle.isCollisionTexture(this) || particle.isCollisionTinting(this));
/*     */       
/* 522 */       if (collisionStuff != collided) {
/*     */         continue;
/*     */       }
/*     */       
/* 526 */       setEmitterVariables(partialTicks);
/* 527 */       setParticleVariables(particle, partialTicks);
/*     */       
/* 529 */       for (IComponentRenderBase component : renderComponents) {
/* 530 */         if (!collisionStuff || component.getClass() != BedrockComponentAppearanceBillboard.class) {
/* 531 */           component.render(this, particle, builder, partialTicks);
/*     */         }
/*     */       } 
/*     */     } 
/*     */     
/* 536 */     Tessellator.func_178181_a().func_78381_a();
/*     */   }
/*     */ 
/*     */   
/*     */   private void setupOpenGL(float partialTicks) {
/* 541 */     Entity camera = Minecraft.func_71410_x().func_175606_aa();
/* 542 */     double playerX = camera.field_70169_q + (camera.field_70165_t - camera.field_70169_q) * partialTicks;
/* 543 */     double playerY = camera.field_70167_r + (camera.field_70163_u - camera.field_70167_r) * partialTicks;
/* 544 */     double playerZ = camera.field_70166_s + (camera.field_70161_v - camera.field_70166_s) * partialTicks;
/*     */     
/* 546 */     GlStateManager.func_179147_l();
/* 547 */     GlStateManager.func_179141_d();
/* 548 */     GlStateManager.func_187401_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
/* 549 */     GlStateManager.func_179092_a(516, 0.0F);
/*     */     
/* 551 */     BufferBuilder builder = Tessellator.func_178181_a().func_178180_c();
/*     */     
/* 553 */     GlStateManager.func_179090_x();
/*     */     
/* 555 */     builder.func_178969_c(-playerX, -playerY, -playerZ);
/*     */     
/* 557 */     GlStateManager.func_179129_p();
/* 558 */     GlStateManager.func_179098_w();
/*     */   }
/*     */ 
/*     */   
/*     */   private void endOpenGL() {
/* 563 */     Tessellator.func_178181_a().func_178180_c().func_178969_c(0.0D, 0.0D, 0.0D);
/*     */     
/* 565 */     GlStateManager.func_179084_k();
/* 566 */     GlStateManager.func_179092_a(516, 0.1F);
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   private void depthSorting() {}
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public void setupCameraProperties(float partialTicks) {
/* 591 */     if (this.world != null) {
/* 592 */       Entity camera = Minecraft.func_71410_x().func_175606_aa();
/*     */       
/* 594 */       this.perspective = (Minecraft.func_71410_x()).field_71474_y.field_74320_O;
/* 595 */       this.cYaw = 180.0F - Interpolations.lerp(camera.field_70126_B, camera.field_70177_z, partialTicks);
/* 596 */       this.cPitch = 180.0F - Interpolations.lerp(camera.field_70127_C, camera.field_70125_A, partialTicks);
/*     */       
/* 598 */       this.cX = Interpolations.lerp(camera.field_70169_q, camera.field_70165_t, partialTicks);
/* 599 */       this.cY = Interpolations.lerp(camera.field_70167_r, camera.field_70163_u, partialTicks) + camera.func_70047_e();
/* 600 */       this.cZ = Interpolations.lerp(camera.field_70166_s, camera.field_70161_v, partialTicks);
/*     */     } 
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public int getBrightnessForRender(float partialTicks, double x, double y, double z) {
/* 608 */     if (this.lit || this.world == null) {
/* 609 */       return 15728880;
/*     */     }
/*     */     
/* 612 */     this.blockPos.func_189532_c(x, y, z);
/*     */     
/* 614 */     return this.world.func_175667_e((BlockPos)this.blockPos) ? this.world.func_175626_b((BlockPos)this.blockPos, 0) : 0;
/*     */   }
/*     */   
/*     */   public static EntityLivingBase findLivingEntity(UUID uuid) {
/* 618 */     if (uuid == null) return null; 
/* 619 */     for (Entity entity : FMLClientHandler.instance().getWorldClient().func_72910_y()) {
/* 620 */       if (entity instanceof EntityLivingBase && entity.func_110124_au().equals(uuid))
/* 621 */         return (EntityLivingBase)entity; 
/*     */     } 
/* 623 */     return null;
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\blockbuster\emitter\BedrockEmitter.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */